import request from '@/utils/request'

export function saveGoods(data) {
  return request({
    url: '/api/base/goods/save',
    method: 'post',
    data
  })
}

export function saveAllGoods(data) {
  return request({
    url: '/api/base/goods/save_all',
    method: 'post',
    data
  })
}

export function updateGoods(data) {
  return request({
    url: '/api/base/goods/update',
    method: 'post',
    data
  })
}

export function getGoodsByCode(data) {
  return request({
    url: '/api/base/goods/get_by_code',
    method: 'post',
    data
  })
}

export function listGoods(data) {
  return request({
    url: '/api/base/goods/list',
    method: 'post',
    data
  })
}

export function pageGoods(data) {
  return request({
    url: '/api/base/goods/page',
    method: 'post',
    data
  })
}

export function listGoodsByCode(data) {
  return request({
    url: '/api/base/goods/list_by_code',
    method: 'post',
    data
  })
}

export function listGoodsByFullCode(data) {
  return request({
    url: '/api/base/goods/list_by_full_code',
    method: 'post',
    data
  })
}

export function listGoodsByAbbr(data) {
  return request({
    url: '/api/base/goods/list_by_abbr',
    method: 'post',
    data
  })
}

export function listPreOptions() {
  return request({
    url: '/api/base/goods/list_pre_options',
    method: 'get'
  })
}
